package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品信息
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_commodity")
public class Commodity extends Model<Commodity> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "commodity_id", type = IdType.ASSIGN_ID)
    private String commodityId;
    /**
     * 商品编码
     */
    @TableField("commodity_code")
    private String commodityCode;
    /**
     * 商品名称
     */
    @TableField("commodity_name")
    private String commodityName;
    /**
     * 商品简介
     */
    @TableField("commodity_introduction")
    private String commodityIntroduction;
    /**
     * 商品价格
     */
    @TableField("commodity_price")
    private BigDecimal commodityPrice;
    /**
     * 优惠值
     */
    @TableField("discount_value")
    private BigDecimal discountValue;
    /**
     * 用户侧优惠方式
     */
    @TableField("user_discount_methods")
    private String userDiscountMethods;
    /**
     * 用户侧优惠值
     */
    @TableField("user_discount_value")
    private BigDecimal userDiscountValue;
    /**
     * 商品图片
     */
    @TableField("commodity_pic")
    private String commodityPic;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 删除时间
     */
    @TableField(value = "delete_time",fill = FieldFill.UPDATE)
    private LocalDateTime deleteTime;
    /**
     * 是否删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;
    /**
     * 是否启用
     */
    @TableField("enable")
    private String enable;
    /**
     * 操作人
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "operator")
    private String operator;
    /**
     * 机构ID
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS, value = "org_id")
    private String orgId;
    /**
     * 品牌
     */
    @TableField("brand")
    private String brand;
    /**
     * 供应商
     */
    @TableField("supplier")
    private String supplier;
    /**
     * 优惠方式
     */
    @TableField("discount_methods")
    private String discountMethods;
    /**
     * 产品形式
     */
    @TableField("product_form")
    private String productForm;
    /**
     * 是否组合商品
     */
    @TableField("combined_commodity")
    private String combinedCommodity;
    /**
     * 用户售价
     */
    @TableField("user_price")
    private BigDecimal userPrice;

    public void freeData() {
        this.commodityId = null;
        this.commodityCode = null;
        this.commodityName = null;
        this.commodityIntroduction = null;
        this.commodityPrice = null;
        this.discountValue = null;
        this.userDiscountMethods = null;
        this.userDiscountValue = null;
        this.commodityPic = null;
        this.addTime = null;
        this.updateTime = null;
        this.deleteTime = null;
        this.isDeleted = null;
        this.enable = null;
        this.operator = null;
        this.orgId = null;
        this.brand = null;
        this.supplier = null;
        this.discountMethods = null;
        this.productForm = null;
        this.combinedCommodity = null;
        this.userPrice = null;
    }

}
